package org.zjh.view.Introduce;

import org.zjh.constant.ImageConstant;
import org.zjh.controller.listener.FrameCloseLis;

import javax.swing.*;
import java.awt.*;

/**
 * @description: 游戏介绍窗口
 * @author 郑佳豪
 * @date 2024/10/6 3:03
 * @version 1.0
 */
public class GameIntroduceFrame extends JFrame {

    public static final int WIDTH = 1024;
    public static final int HEIGHT = 580;

    private GameIntroducePanel gameIntroducePanel;

    public GameIntroduceFrame() {
        init();
        addListener();
    }

    /**
     * 初始化窗口
     */
    private void init() {
        setLayout(new BorderLayout());
        setSize(WIDTH, HEIGHT);
        gameIntroducePanel = new GameIntroducePanel();
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
        setTitle("欢乐斗地主");
        setResizable(false);
        add(gameIntroducePanel);
        setIconImage(ImageConstant.Frame_Title_IMAGE.getImage());
        setVisible(false);
    }

    /**
     * 添加监听器
     */
    private void addListener() {
        addWindowListener(FrameCloseLis.getInstance());
    }
}
